package com.inscream.app;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.webkit.WebView;
import android.widget.ImageButton;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.inscream.app.profileTab.FollowTab;


public class ProfileActivity extends Activity {

    RelativeLayout editMyProfile, myFavorites, myScream;
    private WebView webView1;
    TextView followerCount, followerText, followingCount, followingText;
    ImageButton twitterButton, facebookButton;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_profile);

        twitterButton = (ImageButton) findViewById(R.id.twitterButton);
        facebookButton = (ImageButton) findViewById(R.id.facebookButton);

        twitterButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(Intent.ACTION_VIEW,
                        Uri.parse("http://www.twitter.com"));
                startActivity(intent);
            }
        });
        facebookButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(Intent.ACTION_VIEW,
                        Uri.parse("http://www.facebook.com"));
                startActivity(intent);

            }
        });

        followerCount = (TextView) findViewById(R.id.followerCount);
        followerText = (TextView) findViewById(R.id.followerText);
        followingCount = (TextView) findViewById(R.id.followingCount);
        followingText = (TextView) findViewById(R.id.followingText);

        followerCount.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent in = new Intent(ProfileActivity.this, FollowTab.class);
                startActivity(in);
            }
        });

        followingCount.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent in = new Intent(ProfileActivity.this, FollowTab.class);
                startActivity(in);
            }
        });
        followerText.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent in = new Intent(ProfileActivity.this, FollowTab.class);
                startActivity(in);
            }
        });

        followingText.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent in = new Intent(ProfileActivity.this, FollowTab.class);
                startActivity(in);
            }
        });
     //   editMyProfile = (RelativeLayout) findViewById(R.id.editMyProfile);
     //   myFavorites = (RelativeLayout) findViewById(R.id.myFavorites);
    //    myScream = (RelativeLayout) findViewById(R.id.myScream);
    }

  /*  public void doStuff(View v){
        switch(v.getId()){
            case R.id.editMyProfile:
                Intent myProfile = new Intent(ProfileActivity.this, TabTab.class);
                startActivity(myProfile);
                break;
            case R.id.myFavorites:
                Toast.makeText(getApplicationContext(), "myFavorites", Toast.LENGTH_SHORT).show();
                break;
            case R.id.myScream:
                Toast.makeText(getApplicationContext(), "myScream", Toast.LENGTH_SHORT).show();
                break;
            default:
                //myScream
                break;
        }
    }
    */


    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.profile, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        int id = item.getItemId();
        if (id == R.id.action_settings) {
            return true;
        }
        return super.onOptionsItemSelected(item);
    }
}
